package com.itheima.d3_transform_stream;

import java.io.*;

/**
 * 目标：掌握字符输出转换流的使用。
 */
public class Test3OutputStreamWriter {
    public static void main(String[] args) {

        try (final FileOutputStream fos = new FileOutputStream("day10io-app2/file/咏鹅.txt");
             final OutputStreamWriter ops = new OutputStreamWriter(fos, "GBK");
             final BufferedWriter bw = new BufferedWriter(ops)){
            bw.write("咏樊");
            bw.newLine();
            bw.write("樊樊樊");
            bw.newLine();
            bw.write("曲项向天歌");
            bw.newLine();
            bw.write("黑毛浮绿水");
            bw.newLine();
            bw.write("红掌拨清波");
            bw.newLine();

        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
